home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 1-4 / Prograph Reference 1-4.rsrc / TEXT_146.txt < prev    next >
Encoding:
Text File  |  1995-10-21  |  9.1 KB  |  275 lines

  1.  
  2. t    Windows*106*
  3.  
  4. When control is transferred from the Application to the editor/interpreter environment either by the user or by the interpreter, execution is suspended. When an execution is suspended:
  5.  
  6. o    The interpreter windows (also called execution windows) are displayed with a dotted background, in contrast to the plain background of editing windows. The execution windows displayed in this environment are the Stack window and case windows. Unless otherwise specified, the term ‚Äúwindow‚Äù is used in this section to mean ‚Äúexecution window.‚Äù
  7.  
  8. o    Prograph allows the user to start a new execution.*106*
  9.  
  10. Prograph supports multiple executions. If several executions are active, they all appear stacked in the Stack window in the order in which they were started, separated by horizontal fuzzy lines. The lowest icon in each execution indicates the top of the stack for that execution. 
  11.  
  12. A case window displays the details of a case in the stack. Although editing is not allowed in such windows, Prograph allows the user to alter the status of execution and to open the editing case window from the execution case window to alter the structure of the method. *106*
  13.  
  14. Stack Window*107*
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. This window displays the cases under execution as a stack of named icons, each containing a case number. The stack grows from top to bottom, so the lowest icon in the stack window represents the element at the top of the stack. 
  31.  
  32. The format of the name appearing below the icon depends on whether the case belongs to a universal method, a class method (Plain, Get, Set, or Initialization) or a Local. When a case belongs to a Local, its name appears in plain text; otherwise, it is displayed in bold characters.  *107*
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44. Prograph supports multiple executions, each execution being separated from the next by a horizontal gray fuzzy line(green on a color monitor) in the Stack window.*107*
  45.  
  46. Opening*108*
  47.  
  48. This window is opened:
  49.  
  50. o    when Stack is selected from the Windows menu
  51.  
  52. o    when execution is proceeding in uninterrupted mode and Command- . (period) is pressed.
  53.  
  54. Actions*108*
  55.  
  56. The icons in the Stack window cannot be dragged. However, the following actions are possible:
  57.  
  58. o    Pressing the Return key resumes execution., and, if in step mode, opens the execution case window of the method on top of the stack (bottom of the Stack window).
  59.  
  60. o    Double-clicking on any case icon opens its corresponding execution case window. 
  61.  
  62. o    The level of debugging can be set on a selected icon or group of icons. For details about the level of debugging, please refer to the ‚ÄúMenus‚Äù section below in this chapter. 
  63.  
  64. o    Command-clicking on an icon causes execution to be rolled back as explained below.  
  65.  
  66. Rollback*108*
  67.  
  68. When the user Command-clicks on an icon in the Stack window, execution is undone until the clicked icon is at the top of the stack, that is, until it is the lowest icon in the Stack window. Consequently, if several executions are in progress, all executions following the one containing the clicked icon are discarded. As icons are removed from the Stack window during this process, their execution case windows are closed. *108*
  69.  
  70. Case Window*109*
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86. A case window shows the state of execution of a method by employing different styles for drawing operations, roots, and terminals. Each case window has one selected operation (drawn in red on a color monitor), which is the one under execution. All the operations that have executed are drawn normally (blue on a color monitor), while all the unexecuted operations are drawn in fuzzy gray (fuzzy green on a color monitor).  
  87.  
  88. Opening*109*
  89.  
  90. A case window opens:
  91.  
  92. o    when an icon in the Stack window is double-clicked
  93.  
  94. o    when an error occurs in executing an operation in the case
  95.  
  96. o    when a Breakpoint set on an operation in the case is encountered during execution
  97.  
  98. o    when Trace in the Exec menu is checked
  99.  
  100. o    when Show Cases is turned on for the method 
  101.  
  102. Actions*109*
  103.  
  104. The following actions are possible in the case window:
  105.  
  106. o    Pressing the Return key causes execution to continue.*109*
  107.  
  108. o    Double-clicking on the dotted background opens an editable window for the same case. Changes made in the editable case window are automatically made in the execution case window, either immediately, or, with text editing of names or comments, when some event occurs that signifies the end of the text editing.*110*
  109.  
  110. o    Double-clicking on an operation has the same effect as in the Editor.
  111.  
  112. o    Command-clicking on an operation selects it as the next operation to be executed. This can cause rollback or roll forward (further explained below).*110*
  113.  
  114. o    Double-clicking on a root of an executed operation opens a Value window. The Value window not only displays the value at the root, but the user can also modify the value, provided that the case is the top stack element.
  115.  
  116. o    Clicking on a root or terminal of an executed operation and keeping the mouse key depressed displays a popup containing the current value of that root or terminal.
  117.  
  118.  For example, double-clicking on the root Side 2 in the execution case window of the universal method Pythagoras opens its Value window.*110*
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. Displaying Values*110*
  137.  
  138. To display the current value of a root or terminal, single-click (holding the mouse button down) on that root or terminal, as illustrated in the following example:
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157. In the next example, due to the synchro link, Side 2 must execute before Side 1. Yet even though the * operation for Side 1 has not yet executed, and its terminal is filled in, you can still single-click to examine the value for this terminal, because the input bar HAS executed, and a value for the Side 1 * operation terminal has arrived (2):*111*
  158.  
  159.  
  160.  
  161.  
  162.  
  163. Opening Value Windows*111*
  164.  
  165. To open a Value window for a root or terminal, double-click on the root or terminal. Click-selecting a root or terminal will open its Value window as well. The Value window operates as usual; you can view or edit the displayed data - as long as that operation has already executed. (Note that unexecuted nodes are filled in, not hollow). 
  166.  
  167. To illustrate this, if you double-click on the Side 1 root in the execution case window of the following sample method Pythagoras before the input bar operation has executed, the following error dialog will result:*111*
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. However, if you double-click the same node after executing the input bar operation (note that the node will now be hollow), the Value window for that node will appear:*112*
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204. Rollback*112*
  205.  
  206. When an execution is suspended and the user edits a case that is under execution, Prograph undoes the execution of all operations in the case that are affected by the change, but preserves the executed state of other executed operations. *112*
  207.  
  208. Similarly, execution is rolled back if the value of a root in a case window is changed. For example, suppose that in the universal method Pythagoras, the operation * getting its values from Side 2 is executed before the other operation * getting its values from Side 1.*113*
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228. If the value appearing at Side 2 is changed as described above, by opening the Value window when the primitive + is about to be executed, execution is undone, but only in the operation that gets its value from Side 2. The * operation that gets its value from Side 1, however, remains executed even though it previously had been executed after the * operation that is undone (see examples above and below).*113*
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248. In general, execution in a case can rollback if:*113*
  249.  
  250. o    the user Command-clicks on an executed operation
  251.  
  252. o    changes made in an editing case window affect executed operations in the window
  253.  
  254. o    the user closes a Value window on an executed root or terminal by clicking the OK button*113*
  255.  
  256. Since the state of execution within a case window changes with rollback, the case window is redrawn to reflect the change. *114*
  257.  
  258. Roll Forward*113*
  259.  
  260. It is possible for the user to advance the state of execution in a case, avoiding the execution of some operations, by the following means:
  261.  
  262. o    Command-clicking on an unexecuted operation selects it as the next to be executed. As a result, the operations that would have had to be executed to provide input values to the clicked operation are put into the executed state, and their roots are given the value UNDEFINED.*113*
  263.  
  264. o    Pressing the Tab key places the selected operation in the executed state, giving its roots the value UNDEFINED, and selects the next operation in the normal execution sequence.
  265.  
  266. Since the state of execution within a case window changes with roll forward, the case window is redrawn to reflect the change. 
  267.  
  268. Effect of Roll Forward and Rollback on the Stack*113*
  269.  
  270. Certain actions that cause execution to roll forward or back in a case can also affect the stack.
  271.  
  272. o    If the user presses the Tab key or Command-clicks to change the selected operation in a case window, and the method called by that operation is not at the top of the stack, the stack is undone until that method becomes the top stack element.
  273.  
  274. o    If changes are made in an editing window for a case which is still on the execution stack but not at the top of the stack, the stack is undone until the earliest copy of this case becomes the top stack element. *113*
  275.